import request from '@/utils/request'


const baseUrl=`/admin/system/sysRole`
export default {
  getPageList(page,limit,searchObj){
    return request({
      url:`${baseUrl}/${page}/${limit}`,
      method:"GET",
      params:searchObj
    })
  },
  findRoleById(id){
    return request({
      url:`${baseUrl}/findRoleById/${id}`,
      method:"GET",
    })
  },
  saveRole(data){
    return request({
      url:`${baseUrl}/save`,
      method:"POST",
      data,
    })
  },
  updateRole(data){
    return request({
      url:`${baseUrl}/update`,
      method:"POST",
      data,
    })
  },
  removeRole(id){
    return request({
      url:`${baseUrl}/remove/${id}`,
      method:"delete"
    })
  },
  findAll(){
    return request({
      url:`${baseUrl}/findAll`,
      method:"get"
    })
  },
  batchRemove(data){
    return request({
      url:`${baseUrl}/batchRemove`,
      method:"POST",
      data,
    })
  },
  toAssign(roleId){
    return request({
      url:`${baseUrl}/toAssign/${roleId}`,
      method:"GET"
    })
  },
  doAssign(data){
    return request({
      url:`${baseUrl}/doAssign`,
      method:"POST",
      data
    })
  },
}
